import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
import persistedState from 'vuex-persistedstate'
export default new Vuex.Store({
    state: {
		//公共的变量，这里的变量不能随便修改，只能通过触发mutations的方法才能改变
		buildings:[],
		buildingdata:[],//所有的楼栋列表,
		buildingbody:[]//住户类型
	},
    mutations: {
		setBuilding(state,data){
			state.buildings = data
		},
		setBuildingData(state,data){
			state.buildingdata = data
		},
		setBuildingbody(state,data){
			state.buildingbody = data
		}
	},
    actions: {
		//相当于异步的操作,不能直接改变state的值，只能通过触发mutations的方法才能改变
	},
	  plugins: [persistedState()]
})
